home *** CD-ROM | disk | FTP | other *** search
- property type_list : {"MooV", "MPEG"}
- property extension_list : {".mov", ".mpg"}
-
-
- tell application "QuickTime Player"
- launch
- activate
- try
- --if not (exists movie 1) then error "No movies are open."
- stop every movie
- -- CHECK FOR THE CORRECT VERSION
- set QT_version to (QuickTime version as string)
- set player_version to (version as string)
- if (QT_version is less than "5.0") or ¬
- (player_version is less than "5.0") then
- error "This script requires QuickTime 5.0 or greater." & ¬
- return & return & ¬
- "Current QuickTime Version: " & QT_version & return & ¬
- "Current QuickTime Player Version: " & player_version
- end if
- -- CHECK FOR QUICKTIME PRO
- if QuickTime Pro installed is false then
- set the target_URL to "http://www.apple.com/quicktime/download/"
- set the message_text to "This script requires QuickTime Pro." & return & return & ¬
- "If this computer is currently connected to the Internet, " & ¬
- "click the “Upgrade” button to visit the QuickTime Website at:" & ¬
- return & return & target_URL
- display dialog message_text buttons {"Upgrade", "Cancel"} default button 2
- ignoring application responses
- tell application "Finder"
- open location target_URL
- end tell
- end ignoring
- error number -128
- end if
- set this_folder to choose folder with prompt "Choose a folder containing the movies:"
- set the folder_items to list folder this_folder without invisibles
- set the folder_path to this_folder as string
- repeat with i from 1 to the count of the folder_items
- set this_item to (item i of the folder_items)
- set this_item to (this_folder & this_item) as string
- set the item_info to info for alias this_item
- if ((folder of the item_info is false) and ¬
- (alias of the item_info is false)) and ¬
- (the file type of the item_info is in the type_list) or ¬
- (my check_extension(the name of the item_info) is true) then
- try
- make favorite with data alias this_item
- end try
- end if
- end repeat
- display dialog "The items have been added to the favorites." buttons {"•"} default button 1 giving up after 2
- on error error_message number error_number
- if the error_number is not -128 then
- beep
- display dialog error_message buttons {"Cancel"} default button 1
- end if
- end try
- end tell
-
- on check_extension(this_filename)
- repeat with i from 1 to the count of the extension_list
- if this_filename ends with (item i of the extension_list) then return true
- end repeat
- return false
- end check_extension